﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{
	 

	/// <summary>
	/// SUBMITTED, PARTIALFILLED, CANCELLING. PARTIALCANCELED FILLED CANCELED CREATED
	/// </summary>
	public sealed class OrderState
	{
	  public static readonly OrderState SUBMITTED = new OrderState("SUBMITTED", InnerEnum.SUBMITTED, "submitted");
	  public static readonly OrderState CREATED = new OrderState("CREATED", InnerEnum.CREATED, "created");
	  public static readonly OrderState PARTIALFILLED = new OrderState("PARTIALFILLED", InnerEnum.PARTIALFILLED, "partial-filled");
	  public static readonly OrderState CANCELLING = new OrderState("CANCELLING", InnerEnum.CANCELLING, "cancelling");
	  public static readonly OrderState PARTIALCANCELED = new OrderState("PARTIALCANCELED", InnerEnum.PARTIALCANCELED, "partial-canceled");
	  public static readonly OrderState FILLED = new OrderState("FILLED", InnerEnum.FILLED, "filled");
	  public static readonly OrderState CANCELED = new OrderState("CANCELED", InnerEnum.CANCELED, "canceled");

	  private static readonly IList<OrderState> valueList = new List<OrderState>();

	  static OrderState()
	  {
		  valueList.Add(SUBMITTED);
		  valueList.Add(CREATED);
		  valueList.Add(PARTIALFILLED);
		  valueList.Add(CANCELLING);
		  valueList.Add(PARTIALCANCELED);
		  valueList.Add(FILLED);
		  valueList.Add(CANCELED);
	  }

	  public enum InnerEnum
	  {
		  SUBMITTED,
		  CREATED,
		  PARTIALFILLED,
		  CANCELLING,
		  PARTIALCANCELED,
		  FILLED,
		  CANCELED
	  }

	  public readonly InnerEnum innerEnumValue;
	  private readonly string nameValue;
	  private readonly int ordinalValue;
	  private static int nextOrdinal = 0;


	  private readonly string code;

	  internal OrderState(string name, InnerEnum innerEnum, string code)
	  {
		this.code = code;

		  nameValue = name;
		  ordinalValue = nextOrdinal++;
		  innerEnumValue = innerEnum;
	  }

	  public override string ToString()
	  {
		return code;
	  }

//JAVA TO C# CONVERTER NOTE: Fields cannot have the same name as methods:EnumLookup

		public static IList<OrderState> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public static OrderState valueOf(string name)
		{
			foreach (OrderState enumInstance in OrderState.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}